package com.wno704.intf.task;

import com.wno704.intf.service.DbSourceService;
import com.wno704.intf.service.IntfScriptService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @ClassName UpdateInterfaceTask
 * @Description TODO
 * @Author wno704
 * @Date 2023/4/13 16:07
 * @Version 1.0
 */
@Slf4j
@Component
public class UpdateInterfaceTask {

    @Autowired
    IntfScriptService intfScriptService;

    @Autowired
    DbSourceService dbSourceService;

    @Scheduled(fixedRate = 30000)
    public void updateIntf(){
        log.info("加载需要修改的intf-开始~~~");
        log.info("已加载{}个intf~~~~", intfScriptService.load());
        log.info("已加载{}个dbSource~~~", dbSourceService.load());
        log.info("加载需要加载的intf-结束~~~");
    }
}
